* {
    margin: 0;
    padding: 0;
}

body {
    background: linear-gradient(to right, white, black);
    height: 100vh;
}
.menu-toggler {
    position: absolute;
    // display: block;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
    width: 40px;
    height: 40px;
    // 在最顶层，这样子不会被遮挡
    z-index: 2;
    opacity: 0;
    cursor: pointer;

    // 三条行的那个
    + label {
        width: 40px;
        height: 5px;
        display: block;
        z-index: 1;
        border: 2.5px;
        background: rgba(255, 255, 255, 0.7);
        // 居中显示
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        margin: auto;
        &::before,
        &::after {
            content: '';
            width: 40px;
            height: 5px;
            display: block;
            z-index: 1;
            border-radius: 2.5px;
            background: rgba(255, 255, 255, 0.7);
            transition: transform 0.5s, top 0.5s;
            position: absolute;
            left: 0;
        }
        &::before {
            top: 10px;
        }
        &::after {
            top: -10px;
        }
    }
    &:hover + label {
        &,
        &::before,
        &::after {
            background: #fff;
        }
    }
    &:checked + label {
        // 背景变透明，使中间那条杠变没
        background: transparent;
        &::before,
        &::after {
            top: 0;
            // 设置旋转的中心点，但这步可以不设置，因为默认就是中心
            transform-origin: 50% 50%;
        }
        &::before {
            transform: rotate(45deg);
        }
        &::after {
            transform: rotate(-45deg);
        }
    }

    &:checked ~ ul .menu-item {
        opacity: 1;

        &:nth-child(1) {
            transform: rotate(0deg) translateX(-110px);
        }
        &:nth-child(2) {
            transform: rotate(60deg) translateX(-110px);
        }
        &:nth-child(3) {
            transform: rotate(120deg) translateX(-110px);
        }
        &:nth-child(4) {
            transform: rotate(180deg) translateX(-110px);
        }
        &:nth-child(5) {
            transform: rotate(240deg) translateX(-110px);
        }
        &:nth-child(6) {
            transform: rotate(300deg) translateX(-110px) ;
        }
        a {
            pointer-events: auto;
        }
    }
}

.menu-item {
    position: absolute;
    display: block;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
    width: 80px;
    height: 80px;
    opacity: 0;
    transition: 0.5s;
    a {
        display: block;
        width: inherit;
        height: inherit;
        line-height: 80px;
        color: rgba(255, 255, 255, 0.7);
        background-color: rgba(255, 255, 255, 0.2);
        border-radius: 50%;
        text-align: center;
        text-decoration: none;
        font-size: 40px;
        pointer-events: none;
        transition: 0.2s;
        &:hover {
            box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
            color: #fff;
            background: rgba(255, 255, 255, 0.3);
            font-size: 45px;
        }
    }
    // 有趣，因为大圆旋转过后，还需要用小圆旋转一遍，才能回正
    &:nth-child(1) a {
        transform: rotate(0deg);
    }
    &:nth-child(2) a {
        transform: rotate(-60deg);
    }
    &:nth-child(3) a {
        transform: rotate(-120deg);
    }
    &:nth-child(4) a {
        transform: rotate(-180deg);
    }
    &:nth-child(5) a {
        transform: rotate(-240deg);
    }
    &:nth-child(6) a {
        transform: rotate(-300deg);
    }
}
